/*
 * @Description: 微应用入口
 * @Date: 2023-02-17 11:31:37
 */
import { onMounted, defineComponent, ref } from 'vue'
import { start, addGlobalUncaughtErrorHandler } from 'qiankun'

export default defineComponent({
  setup() {
    const err = ref(false)
    onMounted(() => {
      console.log('加载加载')
      if (!window.qiankunStarted) {
        window.qiankunStarted = true
        console.log('qiankun -- start')
        start({
          sandbox: { experimentalStyleIsolation: true, singular: false }
        })
        // addGlobalUncaughtErrorHandler((event) => {
        //   err.value = true;
        // });
      }
    })
    return () => (
      <>
        <div id="micro-container"></div>
        {/* {err.value && <div>应用加载异常</div>} */}
      </>
    )
  }
})
